<?php

namespace app\admin\model;

use think\Model;


class Cpackage extends Model
{

    

    

    // 表名
    protected $name = 'course_package';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'package_list'
    ];
    

    







    public function course()
    {
        return $this->belongsTo('Course', 'course_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function package()
    {
        return $this->belongsTo(Package::class, 'package_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function getPackageListAttr($value, $data)
    {

    }
}
